﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Sponsor.aspx.cs" Inherits="ProjectSem40701.Admin.Sponsor" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
    <title>Quản lý nhà tài trợ</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <!--
        set tab active here
     -->
    <script type="text/javascript" language="javascript">
        setTab(document.getElementById("2"));
    </script>
    <!--
        end set tab active
     -->
    
    <div id="box">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
            
        <h3>Quản lý nhà tài trợ</h3>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" 
            AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
            DataSourceID="ObjectDataSource1" Skin="Default">
        <MasterTableView CellSpacing="-1" DataKeyNames="SponsorID" DataSourceID="ObjectDataSource1">
            <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>

            <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="SponsorName" HeaderText="Tên" 
                    SortExpression="SponsorName" UniqueName="SponsorName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="SponsorAddress" HeaderText="Địa chỉ" 
                    SortExpression="SponsorAddress" UniqueName="SponsorAddress">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="SponsorPhone" HeaderText="Điện thoại" 
                    SortExpression="SponsorPhone" UniqueName="SponsorPhone">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="SponsorEmail" HeaderText="Email" 
                    SortExpression="SponsorEmail" UniqueName="SponsorEmail">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn AllowFiltering="False" DataField="SponsorStatus" 
                    DataType="System.Int32" HeaderText="Trạng thái" SortExpression="SponsorStatus" 
                    UniqueName="SponsorStatus">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn AllowFiltering="False" UniqueName="TemplateColumn">
                    <ItemTemplate>
                        <asp:HyperLink ID="linkEdit" runat="server" 
                            NavigateUrl='<%# Eval("SponsorID", "SponsorEdit.aspx?sid={0}") %>' Text="Xem"></asp:HyperLink>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
        </telerik:RadGrid>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            DataObjectTypeName="System.Guid" DeleteMethod="Delete" InsertMethod="Insert" 
            OldValuesParameterFormatString="original_{0}" 
            SelectMethod="Get_tbl_Sponsor_Select_All" 
            TypeName="ProjectSem40701.Admin.AdminXSD.SponsorTableAdapters.tbl_SponsorTableAdapter" 
            UpdateMethod="Update">
            <UpdateParameters>
                <asp:Parameter Name="SponsorName" Type="String" />
                <asp:Parameter Name="SponsorAddress" Type="String" />
                <asp:Parameter Name="SponsorPhone" Type="String" />
                <asp:Parameter Name="SponsorEmail" Type="String" />
                <asp:Parameter Name="SponsorDescription" Type="String" />
                <asp:Parameter Name="SponsorStatus" Type="Int32" />
                <asp:Parameter DbType="Guid" Name="Original_SponsorID" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter DbType="Guid" Name="SponsorID" />
                <asp:Parameter Name="SponsorName" Type="String" />
                <asp:Parameter Name="SponsorAddress" Type="String" />
                <asp:Parameter Name="SponsorPhone" Type="String" />
                <asp:Parameter Name="SponsorEmail" Type="String" />
                <asp:Parameter Name="SponsorDescription" Type="String" />
                <asp:Parameter Name="SponsorStatus" Type="Int32" />
            </InsertParameters>
        </asp:ObjectDataSource>
    </div>
        
</asp:Content>
